//
//  NSString+Helper.m
//  BaseFrameworkOC
//
//  Created by Vicent on 2021/9/7.
//

#import "NSString+Helper.h"

@implementation NSString (Helper)

+  (BOOL)isBlankString:(NSString *)aStr {
    if (!aStr) {
        return YES;
    }
    if ([aStr isKindOfClass:[NSNull class]]) {
        return YES;
    }
    NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet];
    NSString *trimmedStr = [aStr stringByTrimmingCharactersInSet:set];
    if (!trimmedStr.length) {
        return YES;
    }
    return NO;
}


// 检查字符串是否是纯数字
+ (BOOL)checkStringIsOnlyDigital:(NSString *)str {
   NSString *string = [str stringByTrimmingCharactersInSet:[NSCharacterSet decimalDigitCharacterSet]];
    if(string.length >0)
    {
        return NO;
    }else return YES;
}

@end
